home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir27
/
grphca22.zip
/
GRAPHICA.HLP
< prev
next >
Wrap
Text File
|
1993-02-03
|
88KB
|
2,686 lines
\about
\
G R A P H I C A
GRAPHICA is a command-driven interactive graphics program for making
presentation quality graphs on a computer. This two-dimensional data
plotting system is designed specifically for scientific and engineering
applications. GRAPHICA is easy to use, interactive, powerful and it runs on
personal computers, mainframes and workstations. With GRAPHICA, you can:
o plot functions or data files
o evaluate and plot mathematical expressions
o fit spline or polynomials to data
o display and print a graph on hardcopy devices
o export graphs in HPGL, PostScript or other formats
o draw text in roman, greek and cyrillic fonts
o get online help
\instructions
Instructions
Invoking the HELP utility
-------------------------
The HELP utility displays information about requested GRAPHICA topics. From
the GRAPHICA command level (in response to the $ prompt), you can display a
list of topics for which help information is available by typing HELP (or ?)
and pressing the RETURN key. The system responds by displaying a brief
description of GRAPHICA, followed by a list of topics for which help is
available, followed by the prompt "Topic?".
Specifying topic names
----------------------
To display information on a particular topic, respond to the prompt by
typing the name of the topic and pressing the RETURN key.
Subtopic information
--------------------
The information displayed by HELP on a particular topic includes a
description of the topic and a list of subtopics that further describe the
topic. To display subtopic information, type one of the subtopic names from
the list in response to the "Subtopic?" prompt.
Special responses to prompts
----------------------------
If you press RETURN in response to the "Subtopic?" prompt instead of typing
a subtopic name, the "Topic?" prompt reappears, enabling you to enter
another topic name. If you press RETURN in response to the "Topic?" prompt,
you will exit from HELP.
You can type a question mark (?) in response to any of the prompts to
redisplay the most recently requested text and a list of topic or subtopic
names. For example, if you type ? in response to the "Subtopic?" prompt, a
list of subtopics is displayed followed by the "Subtopic?" prompt.
\arrow
\noarrow
\show arrows
Syntax:
arrow {tag} {from sx,sy} {to ex,ey} {len} {ang} {type (1-5)}
noarrow {tag}
show arrows
Description:
The 'arrow' command is used to draw arrows. All positions (x,y) default
to 0,0. The x and y values are real numbers. These values can be either in
the paper (inches) or the graph coordinate system (mapped units) depending on
the status of the location flag (see the location command).
The tag is an integer that may be used to identify a given arrow. If no
tag is given, the lowest unused tag value is assigned automatically. This tag
can be used to delete or change a specific arrow. To change any attribute of
an existing arrow, use the arrow command with the appropriate tag, and specify
the parts of the arrow to be changed.
An optional arrow type may be specified. The default arrow type is 3 or
full. Here's a list of the available arrow types:
type = 1 single wing
type = 2 single wing with a back line
type = 3 full
type = 4 full with a half dimension line
type = 5 full with a dimension line
The arrowhead length and width are 20% and 6% of the total arrow length.
If the arrowhead length is less than 1/8", it will remain at 1/8" regardless
of the total arrow length.
Examples:
to set an arrow pointing from the origin to (1,2) use:
graphica> arrow to 1.0,2.0
to set an arrow from (-10,4) to (-5,5), and tag the arrow number 3, use:
graphica> arrow 3 from -10,4 to -5,5
to change the preceding arrow begin at 1.1,1.3, use:
graphica> arrow 3 from 1.1,1.3
to delete arrow number 2 use:
graphica> noarrow 2
to delete all arrows use:
graphica> noarrow
\audit
\show audit
Syntax:
audit {'filename'}
show audit
Description:
This command makes a copy of all your input commands into the given
filename. You may later use it as a 'load' or 'input' file. 'show audit'
tells whether auditing is active or not.
Examples:
graphica> audit 'trace.dat'
graphica> audit
in the latter case, a file called GRAPHICA.ODT will contain a audit trace of
all commands.
\autoscale
\noautoscale
\show autoscale
Syntax:
autoscale {x} {y} {y2} {x2}
noautoscale
show autoscale
Description:
Frequently, it is difficult for the user to select suitable axis limits
and step sizes, especially if the data being plotted varies greatly from one
execution of the program to the next. For this reason GRAPHICA provides
automatic axis scaling for all axes.
The autoscale command sets the autoscaling feature for an axis. If an
axis is not autoscaled, the default or current map is used when data is
plotted.
Examples:
graphica> autoscale x
graphica> noautoscale
Another example. Suppose you have a data file with two columns of data,
x and y but don't know their ranges. You could do the following:
graphica> data 'mydata.dat'
graphica> draw data
graphica> plot x y
and determine how the data looks. The axes are autoscaled. Then you could
say,
graphica> noaxes
graphica> map x 0 100 y 30 200
where the mapped range would be your own values and then,
graphica> draw x y
would draw the axes with the desired mapped range.
\axes
\axis
\noaxes
\show axes
\show axis
Syntax:
axes
noaxes
show axes
Description:
The 'axes' command performs a similar function to that of the 'draw'
command. However, only those axes that have been previously mapped are drawn
with this command.
The 'noaxes' command will delete any previously specified axes, so the
effect is as if the axes had never been drawn. It is very useful for one
important reason: GRAPHICA maintains a list in memory of all the axes that
have been drawn on the same page. For example, if you had 2 graphs on one
page and needed to get a hardcopy, GRAPHICA would have to keep track of where
everything is so that it could give you an exact reproduction on paper of
what you had on your screen. The 'noaxes' command effectively wipes out all
traces of previously drawn axes and lets you start anew.
Examples:
graphica> axes
graphica> noaxes
graphica> show axes
\background
\show background
Syntax:
background {color} {integer}/<name>
show background
Description:
Sets the background color. See the 'pen color' command for more details
on the kinds of colors available to use with this command.
Examples:
graphica> background 3
graphica> back red
\beep
\nobeep
Syntax:
beep
nobeep
Description:
These two commands are used to toggle GRAPHICA beeps on and off. The
default is on.
Examples:
graphica> beep
activates the beep when the screen has been drawn or when there's an error.
graphica> nobeep
turns beeping off.
\character
\show character
Syntax:
character {gap} {ratio} {size} {slant} <value>
character {font} <integer>
show character
Description:
This command sets character attributes such as the font type, character
gap, ratio, size and slant.
Examples:
graphica> character size 0.15 ratio 0.6
graphica> char gap 0.2 slant -10
graphica> character font 2
Also see CHARACTER FONT, CHARACTER GAP, CHARACTER RATIO, CHARACTER SIZE,
CHARACTER SLANT, SUBSCRIPT, SUPERSCRIPT and TEXT.
\font
\character font
\show font
Syntax:
{character} font <integer>
show font
Description:
A font is a collection of characters with a unified design. The
command 'font' defines the font style for characters. Characters may be
hardware or software generated. The default font style is 1 which is a
software generated character. The software generated character fonts are
based on a database originally created by Dr. A.V. Hershey while working
at the U.S. National Bureau of Standards. They have been reorganized and
classified into several groups following the ASCII set. The fonts
currently implemented are:
font 1 = simplex roman
font 2 = simplex greek
font 3 = complex roman
font 4 = complex greek
font 5 = complex cyrillic
and also
font 6 = simplex script
font 7 = complex script
on some systems.
Example:
graphica> font 3
specifies a font of complex roman style.
\character gap
Syntax:
character gap <value>
Description:
The character gap attribute defines the spacing between adjacent
characters in a text string, in the direction of the character path. The
character gap is defined as a fraction of the average character box size.
The default gap of 0.0 implies that adjacent character boxes are to be
abutting. A gap of 1.0 implies that a gap, equivalent to the size of the
average characterbox, is to be inserted between adjacent characters along the
path. A gap of -0.5 implies that character boxes are to partially overlap.
Example:
graphica> character gap 1.0
\character ratio
Syntax:
character ratio <value>
Description:
Specifies the ratio of the width of the character to its height. The
default character ratio is 1.0.
Example:
graphica> character ratio 0.8
\character size
Syntax:
character size <value>
Description:
The 'character size' attribute defines the vertical size of the
characters in default units (in, cm, mm). GRAPHICA sets the default
character size of all strings and labels to 0.17 in.
Example:
graphica> character size 0.2
\character slant
Syntax:
character slant <value>
Description:
Specifies the number of degrees the characters tilt from the vertical.
The sign convention for the direction of rotation is as follows:
+ clockwise
- counterclockwise
The default character slant is 0.0 degrees.
Example:
graphica> character slant 25
\cd
Syntax:
cd <directory-name>
Description:
The 'cd' command changes the working directory to <directory-name>.
Examples:
graphica> cd c:\work
graphica> cd ..
graphica> cd c:\work\examples
\circle
\show circle
Syntax:
circle {center at <x>,<y>} {radius <value>}
show circle
Description:
This command draws a circle with the given radius in user default units at
the given position (also in user default units).
Example:
graphica> circle radius 2.0 center at 3.0 4.0.
\clear
Syntax:
clear
Description:
The 'clear' command erases the current screen or output device as
specified by output. It also resets all internal flags to the default state
found when entering GRAPHICA, i.e. no axes, no frame, default map, etc. This
usually generates a formfeed on hardcopy devices.
Example:
graphica> clear
\column
\show columns
Syntax:
column <integer> {is} {x} {y} {y2} {x2}
show columns
Description:
This powerful command allows the assignment of any data column read from
a user file to a certain axis.
Examples:
graphica> column 3 y2
graphica> column 2 is x 1 is y
assigns column 3 of a data file to the x-axis and column 1 to the y-axis.
Then plot x y add points will generate a graph of column 3 versus column 1.
\comment
Comments are supported as follows: C, c, # or [ may appear in most
places in a line and GRAPHICA will ignore the rest of the line. It will not
have this effect inside quotes or inside numbers (including complex numbers).
Examples:
graphica> [ test file ]
graphica> echo # echo all commands
graphica> # map axes
graphica> map x 0 10 y 0 10
\data
\file
Syntax:
data {from} {file} {'filename'} {autox}
x(1) y(1)
x(2) y(2)
x(3) y(3)
. .
x(n) y(n)
end
Description:
Discrete data contained in a file can displayed by specifying the name
of a data file (enclosed in quotes) on the plot command line. Using the
'data' command simply reads in the data from a file, without plotting it.
Data files may contain one or more data points per line. If more than
one data point is encountered on a line, the data points in a given column
are referred to as columns. If just one value is given on a line, the
program will use the number of the coordinate as the x value. Coordinate
numbers start at 1 and are incremented for each data point read. Lines
beginning with # (or [) will be treated as comments and ignored.
Numbers can be separated by a comma or one or more blanks (free
format). There is no limit to the number of data points possible (well,
until memory is exhausted.) Optionally, data pairs read interactively can
be put on a single input line. You can't input multiple columns of data
interactively, just two columns.
If the data to be plotted is on a data file already, then the command
'data {from} {file}' opens the data file and reads pairs of points. It
is possible to have several sets of data one after another in the same
data file. Simply separate them sets by blank lines: GRAPHICA will read
each set in sequence and plot the curves one after another. This way you
won't need a bunch of data filenames in one script file: just put all the
data in one data file separated by blank lines.
Several columns of data (up to 20) can be read in at once. These can
in turn be assigned to different axes with the COLUMN command later on.
Specifying 'autox' will result in the automatic assignment of the x
values starting from 1. In other words, you may read in one or more columns
of y data only and GRAPHICA will assign the x values for you.
Also see COLUMN.
Examples:
graphica> data 'gel3.dat'
graphica> data file 'comfil'
graphica> data # interactive data input only
graphica> 1.0,10.0 2.0,20.0 3.0,30.0 4.0,40.0 5.0,50.0
graphica> end
graphica> data 'test.dat' autox
In this last example, if 'test.dat' contained only one column of data
(the y values);, x would be assigned automatically by GRAPHICA.
\del
\delete
\rm
Syntax:
del <file>
rm <file>
Description:
The 'del' command deletes a file. Pathnames, wildcards, and drive
designators may be used in the usual way for your operating system. Other
operating system commands can be issued using the $ character followed
by a command. 'rm' works on the Apollo and Coherent versions.
Examples:
graphica> del script.plt
deletes the ASCII file script.plt.
graphica> del foo
deletes the ASCII file foo.
\digitize
Syntax:
digitize
Description:
Establish an X-Y position from a point in the plot. This position is
relative to the plot graphic origin (0,0), the lower left hand corner of the
paper on which the plot appears. If there is a mouse present, the default
pointer will appear and you may move it around. Press any mouse button and
the point will be digitized. If no mouse driver is present, the keyboard
arrow keys will let you move a cross-hair until you hit enter.
Example:
graphica> digitize
\dir
\ls
Syntax:
dir <file>
ls <file>
Description:
The 'dir' command lists the files and subdirectories in a directory.
Pathnames, wildcards, and drive designators may be used in the usual way for
your operating system. Other operating system commands can be issued using
the $ character followed by a command. 'ls' works on the Apollo and
Coherent versions.
Examples:
graphica> dir
lists all files in the current directory.
graphica> dir *.plt
lists all files with an extension of .plt in the current directory.
\divisions
\show divisions
Syntax:
divisions {x} {y} {y2} {x2} <major> <minor>
show divisions
Description:
GRAPHICA draws a tic at each axis value (major tic) and other tic marks
in between (minor tics).
The 'divisions' command determines the number of major and minor tic
marks. These two numbers must be integers. Major and minor tic marks are
one less than the total number of divisions for a particular axis. For
example, if the x-axis range is 0 to 25, a good selection for major divisions
would be 5. The major tic marks will appear at 5, 10, 15, and 20. 5 could
be chosen as the number of minor divisions. This results in four minor tic
marks between two major ones. The defaults are 5,2.
Example:
graphica> divisions x 5,2 y 5,2.
\draw
Syntax:
draw {x} {y} {y2} {x2} {mask} {reflect}
Description:
Draws the specified axis with the given range, tic size and number of
divisions. The key words 'x,x2,y,y2' may be followed by two optional key
words, 'mask' and/or 'reflect'. If 'mask' is specified, that axis is drawn
with the major and minor tic marks but with no numbers or label. If the
'reflect' option is used, a mirror image of that axis is drawn.
Example:
graphica> draw x reflect y reflect.
draws the x and y axes with opposite mirror images.
Note: You may draw more than one axis of the same kind by suitably changing
the subplot area.
\dummy
\show dummy
Syntax:
dummy <dummy-var>
show dummy
Description:
By default, GRAPHICA assumes that the independent variable for the
'plot' command line is 'x'. 'x' is called the dummy variable because it is
just a notation to indicate the independent variable. The 'dummy' command
changes this default dummy variable name. For example, you may find it more
convenient to call the dummy variable 't' when plotting time functions.
Examples:
graphica> dummy t
graphica> dummy s
\dump
Syntax:
dump {device-type} {'filename'}
Description:
Generates hardcopy output into a file. The available device types are:
epson, qms, hpgl, pic, postscript
If the filename is omitted, GRAPHICA will use a default filename of the
form 'graphica.xxx' where .xxx is one of:
.prn, .qms, .hpg, .pic, .ps
depending on the chosen device type. If the device type is missing and you
have defined the environment variable GRAPDUMP, then this device will be
used. A device type specified on the command line overrides any device type
previously specified in GRAPDUMP. You will get an error message if GRAPHICA
can't find a device type somewhere (either in the environment or on the
command line.)
Examples:
graphica> dump hpgl 'plotter.dat'
generates a file called plotter.dat containing HPGL commands. You may send
this file directly to an HP plotter or import it into another program which
accepts HPGL commands, such as WordPerfect, Ventura Publisher, etc.
graphica> dump hpgl
does the same thing except it dumps the output to 'graphica.hpg'.
graphica> dump 'plotter.dat' hpgl
same effect as the first example.
graphica> dump
In this case, if GRAPDUMP=post, a postscript file will be generated, but you
will get an error message otherwise.
On DOS systems,
graphica> dump epson
generates a binary file called 'graphica.prn' which you may send to an
Epson-compatible printer (after you're out of GRAPHICA or by 'shelling' out
to DOS) by typing:
C:\>copy/b graphica.prn lpt1:
The resolution of this plot is 512 x 384 pixels on a 9-pin dot-matrix
printer.
Also see ENVIRONMENT.
\echo
\noecho
Syntax:
echo
noecho
Description:
The 'echo' command causes all input typed at the terminal or picked up
from a load file to be displayed at the terminal. This is useful with a load
file because progress can be monitored. The default is 'noecho.'
Examples:
graphica> echo
switches echoing on
graphica> noecho
switches echoing off.
\quit
\exit
Syntax:
exit
quit
Description:
The commands 'exit' and 'quit' will terminate GRAPHICA. These commands
will clear the output device (as the clear command does) before exiting. If
this command is used in a script file, program execution halts immediately.
Do not use this command until you really want to exit the program.
Example:
graphica> exit
and you will be back at the command line prompt.
\exponent
\noexponent
\show exponent
Syntax:
exponent
noexponent
show exponent
Description:
Use this option to select either a fixed or exponential format for
logarithmic axis tic mark labels.
Exponential format is displayed as the number 10 with an exponent. For
example, the value 0.001 will be displayed as 10 to the power -3 on a log
axis with exponential format.
Example:
graphica> exponent
Also see FORMAT.
\format
\show format
Syntax:
format {x} {y} {y2} {x2} <integer>
format {x} {y} {y2} {x2} ({"<label>"} <pos> {, {"<label>"} <pos>}...)
format {log} n
format {long} {short}
show format
Description:
The main 'format' command controls the format of numbers plotted next to
the major tic marks. The parameter in angle brackets indicates the number of
digits drawn after the decimal point. A -1 or 0 causes the numbers to be
displayed in integer format. The default value for the number of digits to
the right of the decimal point for all axes is 2.
The ("<label>" <pos>, ...) format allows non-numeric tic labels. Each set
of tics can have an optional label. The label is a string enclosed by quotes,
such as "hello". The label may even be empty. You have to include the ( and
) for the non-numeric tic labels to work. Of course, the corresponding axis
will have to be mapped properly for user-defined labels to work. That is, if
you map the y axis from -10 to -5 and specify "format y ("one" 1, "two" 2),
you'll get labels like "-10", etc. instead of "one", "two", etc.
For logarithmic axes, 'format log' controls how often major and minor tic
marks should be labeled. Enter a frequency of:
n = 1 to label all minor tics and all major tics
n = 2 to label even minor tics and all major tics
n = 3 to label minor tics 2 and 5, and all major tics
n = 4 to label minor tic 3, and all major tics
n = 5 to label only major tics.
The result of any GRAPHICA assignment statement is displayed on the screen.
The numeric display format can be controlled using the 'format' command. The
default format, called the 'short' format, shows approximately 5 significant
decimal digits. For the 'long' format (approx. 15 digits) the last
significant digit may appear to be incorrect but the output is actually an
accurate representation of the binary number stored in the computer.
Examples:
graphica> format x 2 y 3
In this example, the x-axis labels will be printed with 2 decimal points and
the y-axis labels with 3.
graphica> format x ("Jan" 1, "Feb" 2, "Mar" 3)
graphica> format y ("bottom" 0, "" 10, "top" 20)
Here, we're using the user-defined axis labels. "Jan" will be printed instead
of a "1", "Feb" instead of 2, and "Mar" instead of 3. In the second example,
the label "bottom" will appear at the "0" position, and "top" will appear at
the "20" position.
graphica> format log 2
in this case, the even minor tic marks will be labeled (2,4,6,8) for each log
cycle.
graphica> a = 4./3.
graphica> format short
graphica> print a
a = 1.33333
graphica> format long
graphica> print a
a = 1.333333333333333
Also see EXPONENT.
\frame
\noframe
Syntax:
frame
noframe
Description:
This command draws a frame around the subplot area. 'noframe' cancels
this effect.
Example:
graphica> frame
produces a frame around the subplot area.
\grid
\nogrid
Syntax:
grid {pen {style} <integer>} {color {type} <integer>}
nogrid
Description:
You may specify whether or not to put a set of horizontal and vertical
reference lines on a plot at the same points as the axis tic marks. The grid
may make it easier to read values off and may improve plot appearance.
The 'grid' command sets an internal flag that signals the axis drawing
routine to generate a grid. 'nogrid' cancels this effect for subsequent axis
draws. The 'pen' and 'color' keywords may be specified to change the
appearance of the grid. The defaults are: nogrid, pen = current pen style +
2, color = current pen color.
Examples:
graphica> grid
graphica> draw x
graphica> grid pen 2 color 3
\help
Syntax:
help <topic>
Description:
If <topic> is not specified, a short message is printed about GRAPHICA.
After help for the requested topic is given, help for a subtopic may be
requested by typing its name, extending the help request. After that
subtopic has been printed, you may extend the request again, as before, or go
back one level to the previous topic, by simply pressing return without
typing anything. Eventually, you will return to the GRAPHICA command line.
Examples:
graphica> help subplot
graphica> help ?
\labels
\nolabels
\show labels
\show titles
Syntax:
label {top} {bottom} {right} {left} "label text"
label {tag} "label_text" {at (x,y)} {justification} {angle}
label {origin} <integer>
nolabel {tag}
show labels
Description:
By default, the text is placed flush left against point x,y. If you
want to adjust the way the label is positioned with respect to the point x,y,
add the parameter <justification>, which may be 'start', 'stop' or 'center'.
This indicates that the point is to be at the left, right or center of the
text. The <justification> may be abbreviated.
The top label lies above the plot frame line. The bottom label is drawn
below the frame. 'start', 'center' and 'stop' cause the program to halt for
pen positioning if a label position was not specified. The start label is
drawn left-justified. The center label is centered around (x,y) and the stop
label is right-justified. The top and bottom labels are centered and each
subsequent label goes either above or below the previously drawn label. The
label will be drawn at an 'angle'from the horizontal.
'tag' is an integer that is used to identify the label. If no tag is
given, the lowest unused tag value is assigned automatically. The tag can be
used to delete or change a specific label. To change any attribute of an
existing label, use the label command with the appropriate tag, and specify
the parts of the label to be changed.
The 'xlabel' command is equivalent to the label bottom command (and so
are the 'x2label', 'ylabel' and 'y2label' commands equivalent to the label
top, left and right commands.)
Examples:
to set a label at (1,2) to "y=x" use:
graphica> label "y=x" at 1,2
to set a label "y=x^2" with the right of the text at (2,3), and
tag the label number 3, use:
graphica> label 3 "y=x\U2" at 2,3 stop
to change the preceding label to center justification, use:
graphica> label 3 center
to delete label number 2 use:
graphica> nolabel 2
to delete all labels use:
graphica> nolabel
\legends
\show legends
Syntax:
legend {framed} {offset <value>} {left} {center}
{right} {flat} {stacked} {at <x>,<y>}
'legend string'
{pen {style} {width} <integer>}
{length {value}}
{symbol {integer}/{name}}
{{pen} color {integer}/{name}}
end
show legends
Description:
This command places a legend at a digitized location. This location is
x/y default units away from the lower left hand corner of the current page
size. If a line pattern is specified a small segment of the line is drawn
before the text. If a symbol is specified, that symbol is drawn before the
text. 'pen', 'length', 'symbol' and 'color' can be specified in any order.
The 'legend' command processes information until the word 'end' is
encountered. 'left', 'center' and 'right' are keywords to place the whole
legend (lines, symbols and text) at that relative given position.
'offset' specifies the separation between lines in a given legend in
multiples of the current character size. The default is 2.5 times the
character size.
'length' specifies the length of the line drawn, if one has been asked
for with the 'pen' keyword. It is in default paper units (inches).
'framed' places a frame around the legend. This frame is also a
masked area. So if you draw a legend first, then anything drawn "over" the
legend will effectively be masked out. You can only have one "masked" area
(see MASK).
'flat' is a keyword used to draw all the legend information in one
line. The default mode of operation is stacked.
Examples:
graphica> legend framed at 2.0 3.0
graphica> 'This is one line with a symbol' symbol square
graphica> color 3 'This second line is in another color'
graphica> pen 4 length 1.0 'one inch line'
graphica> end
graphica> legend center at 5.0,4.0
graphica> symb 1 'experimental data set 1'
graphica> symb 2 'experimental data set 2'
graphica> pen 3 'simulation results'
graphica> end
graphica> legend center at 5.0,4.0 flat framed
graphica> pen 1 'data 1'
graphica> pen 2 'data 2'
graphica> end
This last example draws all the legend information on one line as compared
to the other two examples above which draw stacked legends. See the
example script files 'legend.plt' and 'flat.plt'.
\lines
\nolines
\show lines
Syntax:
line {tag} {from sx,sy} {to ex,ey}
noline {tag}
show lines
Description:
This command is used to make more complicated diagrams by specifying each
line to be drawn. The linked list so created may be corrected and modified
by specifying new coordinates or 'noline'.
Use 'show lines' to check all lines previously specified.
Examples:
graphica> line from 3.0,4.0 to 6.0,8.0
graphica> line 2 to 3.0,5.0
this last command modifies line number 2 to end at (3,5).
\load
\input
Syntax:
load <filename>
input <filename>
Description:
The 'load' command executes each command line of the specified input
file as if they had been typed in interactively. Files created by the
'audit' command can later be loaded. Any text file containing valid commands
can be created and then executed by the 'load' command. Files being loaded
may themselves contain 'load' commands. The 'load' command must be the last
command on the line. The name of the input file must be enclosed in single
or double quotes if there are any non-character elements in the name, e.g.
file.dat has a dot in it so you must enclose it in quotes.
Examples:
graphica> load 'work.plt'
graphica> load "function.dat"
graphica> input 'my.plt'
graphica> input plot
The 'load' command is performed implicitly on any file names given as
arguments to GRAPHICA. These are loaded in the order specified, and then
GRAPHICA exits. For example,
C:\graphica myown.plt
will load GRAPHICA, execute the script file myown.plt and after a key is
pressed, exit to DOS. Notice how quotes are not needed to specify data files
at the command line level. You may specify more than one file,
C:\graphica first.plt second.plt
\location
Syntax:
location {default} {mapped}
Description:
This command allows giving mapped x/y positions in commands like
'legend', 'label', 'line', and 'arrow.'
Examples:
graphica> location mapped
turns a flag on so that are x/y location are interpreted as being in mapped
units.
graphica> location default
turns the flag off so that are x/y location are interpreted as being in user
default units (inches, for example, which is the default.)
\map
\nomap
\show map
Syntax:
map {x} {y} {y2} {x2} <min> <max>
nomap
show map
Description:
The command 'map' defines the ranges of the data for the generation of
axes. These values determine the numbers that appear along the axes. The x
range specifies a range for the bottom x-axis, the x2 range for the top
x-axis, the y range is for the left y-axis and the y2 range for the right
y-axis. If this command is not specified the subplot area is mapped
automatically from the minimum and maximum (x/y) data values entered with the
data command. (This latter procedure will only map the x/y axes, not the
x2/y2 axes.)
Mapping can be turned off with the command 'nomap'.
'show map' shows the currently mapped axes.
Examples:
graphica> map x 0,10 y 0.0,100.0
graphica> map y2 25,-10 x 100,200
\mask
\show mask
Syntax:
mask {area} {on} {off} {<x1>,<y1>,<x2>,<y2>}
nomask
Description:
The 'mask' command defines a masking area. Nothing is drawn over the
masked area if it is currently active. The 'legend' command for example,
creates a mask over the specified legend block and no points or lines are
drawn over it. Use 'nomask' to turn masking off or 'mask on'/'mask off'
to toggle the mask status.
Examples:
graphica> mask 2,3 5,8
graphica> nomask
graphica> mask on
graphica> mask off
\memory
Syntax:
memory
Description:
The 'memory' command gives the number of bytes left in system RAM (only
in the DOS version of GRAPHICA).
Example:
graphica> mem
would give you the following message:
System RAM available: 378,588 bytes.
\origin
\noorigin
\show origin
Syntax:
origin {x} {y} {axis} <other coordinate value>
noorigin
show origin
Description:
The normal plot style is to have the data plotted in a box. It is
possible to cause either the x or y-axis, or both, to be drawn in such a way
that they cross at an arbitrary value. Unless told otherwise, GRAPHICA will
always draw the axes with their origin values at the physical origin (left
bottom side of the graph).
The origin command specifies the axis origin in user defined coordinates.
'show origin' shows the axis origins.
Examples:
graphica> origin x 0 y 0
graphica> norigin
\output
\show output
Syntax:
output {<filename>} {stdout} {com}
show output
Description:
By default, plots are displayed to the standard output (stdout). The
'output' command redirects the display to the specified file or device. The
filename must be enclosed in quotes. If the filename is omitted, output will
be sent to the standard output. 'show output' shows where output is going.
If you're sending output to the communications port (DOS version), make sure
you have configured your serial port with the 'mode' command. For example,
mode com1:96,n,8,1,p
configures a serial port for use at 9600-baud, with no parity checking,
8 bits per character, one stop bit, and with retries. Graphica can only use
the 'com1:' port for output.
Example:
graphica> output 'output.dat'
sends output to the file 'output.dat'.
graphica> output com
sends output to comm port 1 (com1:).
\paper
\noborder
\show paper
Syntax:
paper {size} <dx> {by} <dy> {default}
noborder
show paper
Description:
The most basic elements of a plot are the paper (or page) and the
subplot area. The paper size usually coincides with the graphics device
hardclip limits, that is, no plotting can be done outside this region.
The paper command defines the size of the paper. GRAPHICA sets the page
limits to the standard 11.0 by 8.5 inch paper size. If a raster graphics
terminal is being used the page border is also drawn so that the relative
size of the plot can be ascer- tained. This page border may be turned off by
using the command 'noborder'.
When paper default is specified, the paper size will be reset to its
default value and the page border will be drawn once again.
The paper command is also used to indicate that a new plot is going to
be generated. 'show paper' shows the current paper dimensions.
Examples:
graphica> paper default
graphica> paper 8.5 by 11
graphica> pap size 11 8.5
\parametric
Syntax:
parametric {plot} t tmin,tmax fx(t),fy(t)
{connect {points}} {add {symbols}}
where
t = any dummy variable
tmin = minimum value of the dummy variable
tmax = maximum value of the dummy variable
fx(t) = x coordinate of each point in the curve
fy(t) = y coordinate of each point in the curve
Description:
The plot command allows plotting curves in GRAPHICA in which you give
the y coordinate of each point as a function of the x coordinate. You can
also use GRAPHICA to make parametric plots. In a parametric plot, you give
both the x and y coordinates of each point as a function of a third
parameter, say t. It takes two parametric function specifications in terms
of the paramet- ric dummy argument to describe a single graph. The order the
parametric functions is xfunction, yfunction. Each function operates over
the common parametric domain.
Examples:
graphica> parametric plot t 0,2*pi sin(t) sin(2*t)
graphica> parametric t 0,2*pi sin(t) cos(t)
graphica> parametric plot x 1,4 log(x) log(x**2+x**6)
graphica> r(t) = (3*cos(t)**2-1)/2
graphica> parametric plot t 0 2*pi r(t)*cos(t) r(t)*sin(t)
\pause
Syntax:
pause {<expression>} {"string"}
Description:
Halts execution until a user responds at the keyboard. 'pause' is
useful in conjunction with 'load' files. It displays any text associated
with the command and then waits the specified amount of time. This allows
one to build a load file and control the amount of time a finished graph is
displayed. The first argument can be a negative or a positive integer.
Choosing -1 will have GRAPHICA wait until any key is hit. A positive integer
will have GRAPHICA wait for the specified number of seconds.
The expression and string are optional. If a string is present it must
be enclosed in quotes. If no expression is given, 'pause' waits a default
time of 3 seconds.
Examples:
graphica> pause # Wait a default three seconds
graphica> pause 3 # Wait three seconds
graphica> pause 10 "Isn't this great? It's a cubic spline."
graphica> pause -1 # Wait until a carriage return is hit
graphica> pause -1 "Hit return to continue"
\pen
\color
\pen speed
\pen color
\pen width
\pen style
Syntax:
pen {style} {speed} {width} <value>
pen {color} <integer>/{name}
show pen
Description:
With the 'pen' command, several parameters may be specified, as follows:
To distinguish between the lines of a multiline plot, 'style' defines
the type of the line pattern to use when connecting data points or drawing
lines. The default is 1 (a solid line). All drawing commands are affected
by the pen style command. In other words, the line type remains in effect
until changed. Issue a new pen style command whenever you wish to respecify
the line pattern. There are 8 (eight) pen styles available, with 1 being a
solid line.
'width' defines the pen width in pixels or points. This feature is only
available in devices with variable pen thickness capability. There are 8
(eight) pen widths available, with 1 being a line 1 pixel thick. This is the
default.
'speed' defines the pen speed in a pen plotter in cm/sec. The speed
defaults to the output device's default. (On an HP7475 plotter, this is 30
cm/sec.)
'color' defines the pen color by color code or name. Colors are
assigned to numbers that in turn correspond to the pen numbers on a plotter.
There are currently 16 colors defined for the EGA/VGA color monitor:
0 - black 8 - gray
1 - blue 9 - lblue
2 - green 10 - lgreen
3 - cyan 11 - lcyan
4 - red 12 - lred
5 - magenta 13 - lmagenta
6 - brown 14 - yellow
7 - lgray 15 - white
Examples:
graphica> pen style 1, color 3
graphica> pen width 3
graphica> pen speed 15 (cm/s)
\show pen
\show color
This command shows the current drawing specifications.
\plot
\noplot
\nodata
\errorbars
\connect
\add
\needle
\step
\autox
Syntax:
plot 'data-file' {autox} {data} 'definition' <function>
{connect {points}} {add {symbols}} {needle} {step}
{errorbars {itype}}
noplot
show plots
Definition:
This command generates plots and is the primary GRAPHICA command. It
allows you to plot data, functions and data files.
<function> is a mathematical expression, 'data-file' the name of a data
file enclosed in quotes. If data is specified, previously read-in data is
plotted. The filename may be followed by the 'autox' keyword as in the data
command. In that case, the x values are assigned automatically starting from
data point number 1.
'connect' causes the points to be connected by a straight line of the
specified default line pattern.
For plots with more than one line of data, it may be difficult to tell
the difference between the lines. For this reason, GRAPHICA includes the
capability of marking each point in a line with a symbol. 'add' causes the
specified symbol to be displayed at each data point. Leaving out the word
'add' just draws a line through the data points.
'needle' makes the plot come out such that the y data values are plotted
as needles perpendicular to the x axis.
'step' makes a step plot, useful, for example, for plotting production
data versus years.
The 'errorbars' keyword lets you add error bars to the plotted data
points. An optional integer specifies the type, 1 = no tics, 2 = tics at
end of bar. Error bar values are read in one of two ways: (1) from
columns 3 and 4 of a data file (these two extra values are read in as ylow
and yhigh values for the y values in column 2) or (2) from column 3 (this
value is a delta y). If you're using the 'autox' keyword you need one
column less than specified above since the x values will be assigned
automatically. Two types of error bars may be drawn: type 1 is simply a
vertical line spanning the error; type 2 has to tic marks parallel to the
x-axis, the size of the symbol, like a bracket. The default is type 2.
For axes specified as logarithmic, the log of the data values is
plotted. The log of absolute values is plotted. For zero or negative data
values, the log of 0.001 is plotted.
Optionally, a definition may be given on this line as well.
'noplot' or 'nodata' clears all data points from memory and leaves
GRAPHICA as if no data points or functions had been entered.
'show plots' shows the currently defined plots, including data, functions,
smoothed curves, polynomial fits and shaded data.
Examples:
graphica> plot sin(x)
graphica> plot 'exp.dat'
graphica> plot 'bar.dat' errorbars 1
graphica> plot 'one-y.dat' autox add
graphica> plot data
graphica> plot cos(x) add symbols connect points
graphica> plot s=0.1, t(x)
graphica> noplot
where t(x) has been defined previously and is a function of s.
graphica> show plots
Also see SYMBOL.
\show plots
'show plots' shows the currently defined plots, including data, functions,
smoothed curves, polynomial fits and shaded data.
\plotting
Syntax:
plotting sequence <start>,<stop> {{by} <increment>}
Description:
In case you want the program to plot the data other than in the normal
fashion (start with the first point and plot all points up to the last one),
use this command to alter the program's processing loop. Given as integers,
<start> indicates the first data point to start at, <stop> is the last data
point to plot and <increment> controls which points to pick up within the
start-stop range. The default is to plot all points in increments of 1.
Example:
graphica> plotting sequence 2,10,2
plots points 2, 4, 6, 8 and 10.
\show plotting
Shows the current plotting sequence.
\polyfit
Syntax:
polyfit {{degree} n} {range {min} {max}>
Description:
The 'polyfit' command generates an nth degree polynomial least squares
fit of the current data. The highest degree possible is 10.
Optionally, the range of the given x values may be given and GRAPHICA
will plot the least squares fit from min to max only.
Examples:
graphica> polyfit degree 2
graphica> polyfit range 20 30
\show fit
Shows the current polynomial fitting and correlation coefficients.
\print
Syntax:
print <expression>
<expression>
Description:
The print command prints the value of <expression> to the screen. You
can also determine the value of expressions or variables by just typing the
expression or variable in at the graphica> prompt.
Examples:
graphica> print 2*3
would print out 6.
graphica> 30+2*2
would print out 34.
Also see EXPRESSIONS.
\pwd
Syntax:
pwd
Description:
The pwd command prints the name of the working directory to the screen.
Example:
graphica> pwd
would print out C:\WORK, for example, on DOS systems.
\recall
\editing
Syntax:
recall
Description:
On some systems, GRAPHICA is compiled with a feature called last-line
editing and recall. In that case, the arrow keys on the keypad can be used
to edit mistyped commands or to recall previous command lines. The DOS
version of GRAPHICA does have this feature.
Instead of retyping an entire line, simply hit the up-arrow or down-
arrow keys to recall previous input lines. Then you can move the cursor
over using the left and right-arrow keys and edit the line. The arrow keys
on the keypad work on copies of the previous input lines, which have been
saved in a moderately sized input buffer. Here is a brief description of
their function:
^N or up arrow recall previous line
^P or down arrow recall next line
^B or left arrow move left one character
^F or right arrow move right one character
^A or home move to beginning of line
^E or end move to tend of line
esc cancel current line
^H or del delete character at cursor
backspace delete character left of cursor
^K kills from current position to the end of line
^D deletes the current character, or EOF if line is empty
^L/^R redraw line in case it gets trashed
^U kills the entire line
^W kills last word
RETURN returns the entire line regardless of the cursor position.
On systems without the last-line editing and recall feature, the
'recall' command gives a list of the last 10 user input lines for review.
Example:
graphica> recall
would give out a list such as:
paper size 11 by 8.5
subplot 2 3 6 7
frame
draw x y
\rectangle
\show rectangles
Syntax:
rectangle {from <x1>,<y1>} {to <x2>,<y2>}
show rectangles
Description:
This command generates a rectangle with its lower left hand corner at
<x1>,<y1> and its upper right hand corner at <x2>,<y2>.
Example:
graphica> rectangle from 1.0,2.0 to 3.0,4.0
\revisions
Revision History
----------------
3 Feb 93 - Changed to version 2.2 and uploaded it to CompuServe.
2 Feb 93 - Finally got around fixing the legend routines. The legend
lines weren't quite aligned when center- or right-justified. Added a
new keyword 'flat' to draw non-stacked legends lotus 1-2-3 style. Check
out the 'legend.plt' and flat.plt' scripts file to see how it works.
31 Jan 93 - Added the error and complementary error functions to the
set of user-callable functions. See 'help erf' and 'help erfc'.
30 Jan 93 - Wrote a "getch" function for COHERENT so you can press any
key to continue rather than having to press return. Check out the new
help system.
29 Jan 93 - New feature: you can now have several curves in a data file
by separating the data by blank lines. See help on FILE and the
'world.plt' example script file.
28 Jan 93 - Changed the default color to green.
22 Jan 93 - Fixed BIG BUGS when error bar and probability plotting.
21 Jan 93 - Fixed a tiny little bug with the memory allocation code
of the RECALL function in the DOS version.
20 Jan 93 - Changed version to 2.1.
20 Jan 93 - Changed code in the COHERENT and DOS versions to read in only
help keywords when requesting HELP. The help text is read in from the
help file as needed. The new scheme reduces the memory requirements on
PCs. Now you can load in bigger script files!
14 Jan 93 - Ported GRAPHICA to a Sun 4 workstation (no graphics yet).
Cleaned up the code a little bit, especially dealing with include files.
Should be easier to port to many platforms now.
3 Jan 93 - Changed the mouse routines in the DOS version to use a
software cursor (faster than using getimage/putimage).
2 Jan 93 - Added code to save text screen before going into graphics in
the DOS version. This way when you get back to text mode, previous text
will still be visible.
23 Dec 92 - Added the capability of sending output to com1 in the DOS
version. If you have a plotter connected to that communications port, for
example, you can send hpgl output directly to the plotter (without having
to DUMP to a file and then use COPY FILE COM1: at the DOS prompt.)
23 Dec 92 - Fixed a little buglet when changing terminal types and output
was sent to (stdout). SHOW OUTPUT shows correct output now.
14 Dec 92 - Added further functionality to the 'format' command by
allowing user-defined tic labels. See FORMAT.
14 Dec 92 - Added the 'square-root' type to the family of axis types.
8 Dec 92 - Fixed a bug in the help command. You can abort help by
pressing q/Q/ESC. With the bug, the next help command was invalid.
24 Nov 92 - Added two fonts to the Coherent version, simplex script and
complex script. Also added the font name to SHOW FONT on all versions.
(I'm getting a "DGROUP exceeds 64K" when adding these fonts to the DOS
version. I need to get a compiler without the 64K limit on DGROUP data.)
17 Nov 92 - Fixed a bug with the probability scale. It wasn't drawing
the numeric labels in the right place when plotting an x2 or y2 axis.
12 Nov 92 - Fixed bugs in the 'mask' command. Circles and rectangles are
now being masked correctly.
9 Nov 92 - Released version 2.0 to Simtel.
5 Oct 92 - Uploaded version 2.0 to CompuServe.
4 Oct 92 - Fixed a bug in the parsing routine-you can now enter numbers
preceded by a plus as well as a minus. However, if you enter two numbers,
the second of which is negative, without a comma in between, you'll get an
error.
4 Oct 92 - Fixed another bug in the 'paper' command: if a negative
number is entered, its absolute value is taken.
3 Oct 92 - Added the catalan constant to the built-in constants. Also
added another constant called 'degree' so that you may use trigonometric
functions with angles in degrees, e.g. sin( 20 * degree ). See WHO.
19 Sept 92 - Fixed a quirk with the page border: when in non-interactive
mode (command line script files), GRAPHICA won't change the line specs on
the display to indicate the current line specs (style, width, color).
4 Sept 92 - Finished porting GRAPHICA to Mark William Company's Coherent
v4.0. Active devices are HPGL and PostScript.
21 Aug 92 - Added 'format long' and 'format short' commands to control
the format of numerical results displayed on the screen. Placed old
'logformat' command into 'format' (see FORMAT).
18 Aug 92 - Shortened long color names, e.g. lblue instead of lightblue.
See PEN or COLOR.
17 Aug 92 - Added the 'subscript' and 'superscript' commands but not
active yet (still working on the algorithm). See SUB/SUPERSCRIPT.
16 Aug 92 - Further improvements in the memory management scheme. Almost
all the linked lists are now of one object type. Fixed a bug in the axis
drawing scheme (was drawing axes twice and it took a long time to show the
cross-hair).
15 Aug 92 - Merged together a bunch of "objects" (arrows, circles,
labels, legends, lines, rectangles) into linked lists of the same kind.
14 Aug 92 - No mouse cursor (cross-hair) appears when showing graphs
in batch (not interactively).
10 Aug 92 - Changed all text space allocation to dynamic memory
allocation. Saves a few bytes here and there, especially on the DOS
version.
9 Aug 92 - Added the 'who' command which works just like 'show variables'.
8 Aug 92 - 'nopaper' has been changed to 'noborder' for clarity.
26 Jul 92 - Added the 'memory' command that gives you a (comma separated)
number of free bytes left in RAM. See MEMORY.
25 Jul 92 - Fixed memory allocation problem in data structures. Wasn't
clearing all memory allocated to data points. All memory is now freed
when using the 'clear' command or quitting the program.
24 Jul 92 - Fixed postscript bug, couldn't get 2 consecutive plots out
in the same session. The second page bombed. Works OK now.
24 Jul 92 - Can now enter directories or filenames without quotes after
commands like 'dir', 'del', 'cd', 'type'. GRAPHICA won't bulk at reading
something like cd c:\work without quotes. See CD.
23 Jul 92 - Implemented 'dir', 'del', and 'type' commands. There is no
need to shell out to the operating system to do file maintenance. You can
still use $ to tell GRAPHICA you're using an operating system command.
Useful to edit files, for example. See DIR, DEL and TYPE.
22 Jul 92 - Instead of getting an 'invalid command error' GRAPHICA now
tries to search for variables or expressions. There is no further need to
type 'print expression' to evaluate an expression or a variable. You can
now type in any variable or expression at the GRAPHICA command line. You
can still use the 'print' command as usual.
21 Jul 92 - Corrected problem with the GRAPDUMP environmental variable.
Actually rewrote the algorithm to check for 'dump' devices. Whether a
device can be used as a 'dump' device or not is now built in in a device
table. You'll get an error message when attempting to use an invalid
device for 'dumping'.
20 Jul 92 - Implemented 'title' command. Works just like 'label top' but
writes directly above frame without leaving a space for eventual 'x2' axis
labels. See TITLE.
19 Jul 92 - Added last-line editing and recall on DOS systems. Very
useful to avoid typing in an entire line because you made a little
mistake. See EDITING or RECALL.
\show range
\range
This command shows the input data range (max and min) of each column, if any.
\sampling
\samples
\show sampling
\show samples
Syntax:
sampling <expression>
show sampling
Description:
The sampling rate of functions may be changed by the 'SAMPLING' command.
By default, sampling is set to 150 points. A higher sampling rate will
produce more accurate plots, but will also take longer.
'show sampling' shows the current sampling rate.
Example:
graphica> sampling 200
\shade
Syntax:
shade {spacing} {angle} <value> {mode} <integer>
{closure/noclosure}
Description:
The 'shade' command allows the user to shade a specified polygon.
'spacing' is the vertical distance between shade lines in default user units.
Optionally, a shade 'angle' may be specified. This angle is measured
from the horizontal. The sign convention for the direction of rotation is as
follows:
+ clockwise
- counterclockwise
'mode' indicates the following:
mode = 1 - shade and outline (this is the default)
mode = 2 - shade polygon only
mode = 3 - outline polygon only
The 'closure/noclosure' keyword is used to specify whether GRAPHICA
should draw a line making the polygon a closed one or not. This keyword
is only active when mode is 1 or 3. The default is 'noclosure'.
Example:
graphica> shade angle 35.0 mode 1
\shell
Syntax:
shell
Description:
The shell command spawns an interactive shell. Use this option to
access the operating system prompt and execute commands or run other
programs. When shelling out to the operating system, you can execute any
command or application. To return to GRAPHICA, type exit at the command
line.
A single shell command may be spawned by preceding it with the $ character
at the beginning of a command line. Control will return immediately to
GRAPHICA after this command is executed.
Examples:
graphica> shell
spawns a shell to the operating system. Type exit to return to GRAPHICA.
graphica> $dir
prints a directory listing and then returns to GRAPHICA.
\show
Syntax:
show <parameter>
Description:
The 'show' command lists parameter settings. 'show' without a parameter
simply redraws existing plots on your screen. 'show version' displays:
- your GRAPHICA version number
- pertinent copyright and other information
and on DOS systems:
- the amount of system RAM available
- the amount of disk space available
\spline
Syntax:
spline {plot} {tension {value}} {range {min} {max}}
Description:
A cubic spline interpolator will produce a smooth curve through x/y data
pairs, even if their variation is quite complicated.
The spline command is used to interpolate the current data using splines
under tension. The produced data curve is a spline under tension, which is
somewhat "tighter" than a cubic spline, and less likely to have spurious
inflection points.
The tension factor indicates the curviness desired for the line produced
by the cubic spline. A tension in the interpolating curve of 50 gives almost
a polygonal line; a tension of .01 gives almost a cubic spline. The default
of 2.0 will produce a smooth curve in most cases. For very erratic data it
may be necessary to tighten up the tension factor to 5 or 6 to adequately
follow the data points.
Optionally, the range of the given x values may be given and GRAPHICA
will interpolate from min to max only.
Examples:
graphica> spline plot tension 10
graphica> spline range 20 30
\subplot
\show subplot
Syntax:
subplot {size/area} <xleft> <ybottom> <xright> <ytop>
{default}
show subplot
Description:
The subplot area is also referred to as soft clip. The actual graph
resides in the subplot area but other graphic elements can be drawn outside
the subplot area.
The 'subplot' command defines the region on the paper where the plot is
drawn. By default, the subplot area is set to a rectangle of about 60% of
the paper size. The (xleft,ybottom) pair sets the coordinates of the left
bottom corner of the subplot area, while the (xright, ytop) pair sets the
coordinates of the top right hand corner of the plotting region. If subplot
default is specified, the subplot area size will be reset to its default size.
Data points and curves are drawn or plotted on a grid space formed by
Cartesian coordinate axes. The horizontal line is the x-axis and the vertical
line is the y-axis. These axes are within the subplot area or plotting
region.
'show subplot' shows the current subplot area.
Example:
graphica> subplot area 2.0,2.0 9.0,7.0
\subscript
Syntax:
subscript {size} <value>
Description:
This command sets the subscript size in default units. The default value
is 0.15 inches.
Example:
graphica> subscript size 0.15
Also see CHARACTER FONT, CHARACTER GAP, CHARACTER RATIO, CHARACTER SIZE,
CHARACTER SLANT, SUBSCRIPT, SUPERSCRIPT and TEXT.
\superscript
Syntax:
superscript {size} <value>
Description:
This command sets the superscript size in default units. The default
value is 0.15 inches.
Example:
graphica> superscript size 0.15
Also see CHARACTER FONT, CHARACTER GAP, CHARACTER RATIO, CHARACTER SIZE,
CHARACTER SLANT, SUBSCRIPT, SUPERSCRIPT and TEXT.
\symbol
\show symbol
Syntax:
symbol <code>/<name> size <value>
show symbol
Description:
Defines the symbol to use in displaying data points. Mnemonic codes
may be used to specify a symbol. You have a choice of 10 standard graphics
symbols:
1 - square
2 - circle
3 - triangle
4 - diamond
5 - itriangle (inverted triangle)
6 - hourglass
7 - plus
8 - cross
9 - star
10 - pdiamond (plus within a diamond)
The default is a square (symbol 1 or symbol square). The symbol size is
specified as the height of the current symbol in default units.
'show symbol' shows the current symbol type and size.
Example:
graphica> symbol square size 0.2
\terminal
\show terminal
Syntax:
terminal {<terminal-type>}
show terminal
Description:
GRAPHICA supports many different graphics devices. Use this command to
select the type of device for which GRAPHICA will produce output.
If <terminal-type> is omitted, GRAPHICA will list the available terminal
types. The <terminal-type> may be abbreviated.
Use 'output' to redirect this output to a file or device.
'show terminal' shows the currently defined output terminal.
Examples:
graphica> terminal hpgl
graphica> terminal
would print out the following:
available terminal types:
unknown Unknown terminal type - not a plotting device
bgi IBM PC/Clone with a Hercules/CGA/EGA/VGA graphics card
epson Epson LX-800, Star NL-10, NX-1000, etc
hpgl HPGL Graphics Language and HP7475 plotter
pic PIC Graphics Language
postscript Postscript Graphics Language
and possibly (depending on the version you have) any of the following:
apollo HP Apollo Domain Workstation - direct mode
kercolor Kermit-MS color tek40xx terminal emulator
kermono Kermit-MS monochrome tek40xx terminal emulator
qms QMS Laser Printer
raster Raster Technologies Model One terminal
tek40xx Tektronix 4010 and most TEK emulators
\tics
\show tics
Syntax:
tic {size} <major value> <minor value> {<direction>}
show tics
Description:
All axes are marked off in equal segments with tic marks. The values
major and minor determine the size of the major and minor tic marks. The
defaults are 0.16 and 0.09 inches for the major and minor tic marks,
respectively.
By default, tics are drawn inwards from the border on all four sides.
The 'tic' command can be used to change the tics to be drawn outwards.
<direction> may be in, out or nothing (which is the same as in).
'show tics' shows the current tic size and direction.
Example:
graphica> tic size 0.1 0.06
graphica> tics in
graphica> show tics
\type
\more
Syntax:
type <file>
more <file>
Description:
The 'type' command displays the contents of a file. Pathnames, wildcards,
and drive designators may be used in the usual way for your operating system.
Other operating system commands can be issued using the $ character followed
by a command. 'more' works on the Apollo and Coherent versions.
Examples:
graphica> type script.plt
lists the ASCII file script.plt.
graphica> type foo
lists the ASCII file foo.
\units
\show units
Syntax:
units <unit type>
show units
Description:
It is sometimes desirable to use units other than inches, i.e., the
metric system, with GRAPHICA. To change the unit of measure for parameters
which are usually given in inches use the unit command. This command defines
the units to be used in subsequent commands which represent a length or
position normally supplied in inches, such as in paper size, subplot area,
etc.
The <unit type> may be 'in', 'cm' or 'mm'.
'show units' shows the current units of measure.
Example:
graphica> units cm
\view
Syntax:
view
Description:
Retracts the pen and advances the paper on a pen plotter to view the
graph fully. This command is similar to pushing the VIEW button on an HP7475
plotter.
Example:
graphica> view
would move the plotting paper outward into view.
\x
\y
\x2
\y2
\logarithmic
\probability
\linear
\sqr
Syntax:
{x} {y} {y2} {x2} {linear/logarithmic/probability/sqr}
Description:
With this command, the kind of axis to be plotted may be specified, as
follows:
linear - specifies a linear axis. A linear scale is a standard base 10
numeric scale. This is the default.
logarithmic - specifies a log axis. A log scale is a base 10
logarithmic scale. If a regression has been performed, the values for that
particular axis are logarithmic. Given the mapped range for an axis, the
logarithmic range for that axis will be determined automatically. If an
axis is to be logarithmic, there is no need to specify the number of
divisions or the format. If the range is negative as specified in a map
command, GRAPHICA automatically converts it to positive. Zero values for
min or max will cause the log axis to begin at 0.001.
probability - a probability scale is the inverse of the Gaussian
cumulative distribution function. Thus the graph of the sigmoidally shaped
Gaussian cumulative distribution function on a probability scale will be a
straight line.
Probabilities are expressed as a percentage so that the range of the
scale is from 0 to 100. The minimum and maximum values that a probability
axis can take in GRAPHICA are 0.01 and 99.99. A probability axis label could
be specified as something like "cumulative frequency, %".
sqr - square-root axis. Used in some engineering applications. A square
root scale is based on the square root of the axis in question.
Examples:
graphica> x lin
graphica> y log
graphica> x2 pro
graphica> x sqr
\xlabel
\ylabel
\x2label
\y2label
Syntax:
{xlabel} {x2label} {ylabel} {y2label} 'string'
Description:
This command draws a centered label for that axis. The label text must
be enclosed in single or double quotes. All labels are drawn using the
current character font and size. The label bottom command is equivalent to
the xlabel command (and so are the 'label top', 'left', and 'right' commands
equivalent to the 'x2label', 'ylabel' and 'y2label' commands.)
Example:
graphica> xlabel 'This is the x-axis label'.
graphica> ylabel 'This is the y-axis label'.
\expressions
In general, any mathematical expression accepted by C, FORTRAN, Pascal,
or BASIC is valid. The precedence of these operators is determined by the
specifications of the C programming language. White space (spaces and tabs)
is ignored inside expressions.
Complex constants may be expressed as {<real>,<imag>}, where <real> and
<imag> must be numerical constants. For example, {3,2} represents 3 + 2i;
{0,1} represents 'i' itself. The curly braces are explicitly required here.
\expressions functions
\functions
All functions in GRAPHICA accept integer, real, and complex arguments,
unless otherwise noted.
\expressions functions abs
\functions abs
\abs
abs(z) returns the absolute value of the real or complex number z. The
returned value is of the same type as the argument. For complex arguments,
abs(z) is defined as the length of z in the complex plane [i.e.,
sqrt(real(z)**2 + imag(z)**2) ].
\expressions functions acos
\functions acos
\acos
acos(z) returns the arc cosine (inverse cosine) of z. All results are
given in radians.
\expressions functions arg
\functions arg
\arg
arg(z) returns the phase angle of a complex number z, in radians. The
result is always between -π and π.
\expressions functions asin
\functions asin
\asin
asin(z) returns the arc sine (inverse sine) of z. All results are given
in radians.
\expressions functions atan
\functions atan
\atan
atan(z) returns the arc tangent (inverse tangent) of z. All results are
given in radians.
\expressions functions besj0
\functions besj0
\besj0
besj0(z) returns the j0th Bessel function of z. besj0 expects z to be
in radians.
Also see BESSEL.
\expressions functions besj1
\functions besj1
\besj1
besj1(z) returns the j1st Bessel function of z. besj1 expects z to be
in radians.
Also see BESSEL.
\expressions functions besy0
\functions besy0
\besy0
besy0(z) returns the y0th Bessel function of z. besy0 expects z to be
in radians.
Also see BESSEL.
\expressions functions besy1
\functions besy1
\besy1
besy1(z) returns the y1st Bessel function of z. besy1 expects z to be
in radians.
Also see BESSEL.
\expressions functions ceil
\functions ceil
\ceil
ceil(z) returns the smallest integer greater than z. For complex
numbers, ceil returns the smallest integer greater than the real part of z.
\expressions functions cos
\functions cos
\cos
cos(z) returns the cosine of z. cos expects z to be in radians.
\expressions functions cosh
\functions cosh
\cosh
cosh(z) returns the hyperbolic cosine of z. cosh expects z to be in
radians.
\expressions functions exp
\functions exp
\exp
exp(z) returns the exponential function of z (e raised to the power of
z).
\expressions functions erf
\functions erf
\erf
erf(z) returns the error function of z. erf(z) is the integral of the
Gaussian distribution. The error function is central to many calculations
in statistics.
\expressions functions erfc
\functions erfc
\erfc
erfc(z) returns the complementary error function of z. erfc(z) is
simply 1.0 - erf(z), where erf(z) is the integral of the Gaussian
distribution.
\expressions functions floor
\functions floor
\floor
floor(z) returns the greatest integer less than or equal to z. For
complex numbers, floor returns the largest integer not greater than the real
part of z.
\expressions functions imag
\functions imag
\imag
imag(z) returns the imaginary part of z as a real number.
\expressions functions int
\functions int
\int
int(z) returns the integer part of z, truncated toward zero.
\expressions functions ln
\functions ln
\ln
ln(z) returns the natural logarithm (base e) of z.
\expressions functions log
\functions log
\log
log(z) returns the logarithm (base 10) of z.
\expressions functions real
\functions real
\real
real(z) returns the real part of z.
\expressions functions sgn
\functions sgn
\sgn
sgn(z) returns 1 if z is positive, -1 if z is negative, and 0 if z is 0.
If z is a complex value, the imaginary component is ignored.
\expressions functions sin
\functions sin
\sin
sin(z) returns the sine of z. sin expects z to be in radians.
\expressions functions sinh
\functions sinh
\sinh
sinh(z) returns the hyperbolic sine of z. sinh expects z to
be in radians.
\expressions functions sqrt
\functions sqrt
\sqrt
sqrt(z) returns the square root of z.
\expressions functions tan
\functions tan
\tan
tan(z) returns the tangent of z. tan expects z to be in radians.
\expressions functions tanh
\functions tanh
\tanh
tanh(z) returns the hyperbolic tangent of z. tanh expects
z to be in radians.
\expressions operators
\operators
All operators in GRAPHICA accept integer, real, and complex arguments,
unless otherwise noted. The ** operator (exponentiation) is supported, as in
FORTRAN.
Parentheses may be used to change order of evaluation.
\expressions operators binary
\operators binary
\binary
The following is a list of all the binary operators and their usage:
symbol example explanation
** a**b exponentiation
* a*b multiplication
/ a/b division
% a%b * modulo
+ a+b addition
- a-b subtraction
== a==b equality
!= a!=b inequality
& a&b * bitwise AND
^ a^b * bitwise exclusive OR
| a|b * bitwise inclusive OR
&& a&&b * logical AND
|| a||b * logical OR
(*) Operator requires integer arguments.
Logical AND (&&) and OR (||) short-circuit the way they do in C. That
is, the second && operand is not evaluated if the first is false; the second
|| operand is not evaluated if the first is true.
Multiplication must be explicitly noted with the asterisk; adjacent
parenthetical terms such as (a+b)(c-4) are not automatically multiplied.
\expressions operators ternary
\operators ternary
\ternary
The following is a list of the ternary operator and its usage:
symbol example explanation
\: a\b:c * ternary operation
(*) Operator requires an integer argument.
The ternary operator evaluates its first argument (a). If it is true
(non-zero) the second argument (b) is evaluated and returned, otherwise the
third argument (c) is evaluated and returned.
\expressions operators unary
\operators unary
\unary
The following is a list of all the unary operators and their usage:
symbol example explanation
- -a unary minus
~ ~a * one's complement
! !a * logical negation
! a! * factorial
(*) Operator requires an integer argument.
The factorial operator returns a real number to allow a greater range.
\bessel
Bessel functions arise in solving differential equations for systems
with cylindrical symmetry. Jn(z) is often called the Bessel function of
the first kind, or simply the Bessel function. Yn(z) is referred to as
the Bessel function of the second kind, the Weber function, or the Newmann
function (denoted Nn(z)).
Four Bessel functions are provided with GRAPHICA: besj0, besj1, besy0
and besy1. besj0(z) returns the j0th Bessel function of z, besj1(z)
returns the j1st Bessel function of z, besy0(z) returns the y0th Bessel
function of z and besy1(z) returns the y1st Bessel function of z. All
Bessel functions expect z to be in radians.
Also see BESJ0, BESJ1, BESY0, BESY1.
\environment
An environment variable is used to specify from the operating system
certain parameters of program operation. The "environment" is really just
a common area of memory that programs can write to and read from. Some
programs are geared to look specifically at the environment to find
particular data important to their operation. They may ask you to place a
variable into the environment equal to a certain value so that they can
find support files which could not be found otherwise.
A number of shell environment variables are understood by GRAPHICA.
None of these are required, but may be useful:
- GRAPTERM
- GRAPDUMP
- GRAPHELP
- GRAPHICA
If GRAPTERM is defined, it is used as the name of the terminal type
to be used. This overrides any terminal type sensed by GRAPHICA on start
up, but is itself overridden by the GRAPHICA.INI (or equivalent) start-up
file, and of course by later explicit changes. GRAPDUMP is used as the
default terminal type used when dumping graphics to a file.
GRAPHELP may be defined to be the pathname of the help file.
GRAPHICA is used as the name of a directory to search for a GRAPHICA.INI
file if none is found in the current directory. COMSPEC is used for the
SHELL command on DOS systems.
DOS Environment Variables
-------------------------
If we were to look at the DOS environment (by typing the SET command
at the DOS prompt), we might see a listing similar to the one below:
COMSPEC=C:\COMMAND.COM
PATH=C:\;C:\DOS;C:\UTIL
Other values might be present, like PROMPT=$P$G, and more depending
on the types and kinds of software you are running.
Environment variables are specified before running GRAPHICA. They
can be specified directly from DOS, from within the AUTOEXEC.BAT file, or
from within any batch file.
The command for setting an environment variable is:
SET PARAMETER=PARAMETER VALUE
Examples:
C:\SET GRAPDUMP=hpgl (sets the dump terminal type)
C:\SET GRAPHELP=C:\plot\graphica.hlp (the help file)
C:\SET GRAPHICA=C:\plot (location of the .INI file)
In general, you won't have to set the DOS environment variable GRAPTERM if
you have any of the commonly available graphics monitors, CGA/EGA/VGA, etc.
VAX/VMS Logical Symbols
-----------------------
On a VAX, environment variables are called 'symbols.' The format for
defining a symbolic name for a character string is:
symbol-name :== expression
For example, we could define the following symbols:
$ LIST :== "DIRECTORY"
$ TIME :== "SHOW TIME"
$ QP :== "SHOW QUEUE/DEVICE"
$ SS :== "SHOW SYMBOL"
To looking at the environment, you may type SHOW SYMBOL/GLOBAL/ALL at the
$ prompt).
Examples:
$ GRAPDUMP :== hpgl (sets the dump terminal type)
$ GRAPTERM :== raster (sets the terminal type)
$ GRAPHICA :== dua7:[user.junk]graph.ini (location of the .INI file)
(GRAPHELP has already been defined for you.)
Unix Shell Variables
--------------------
In a UNIX environment, things get a little bit confusing because of
the different shells that you might be running. Environment variables can
be shown by using the 'printenv' command (Korn-shell or /bin/sh), the
'setenv' command (c-shell or /bin/csh) or the 'AEGIS' command (Aegis
shell on Apollos). To set them, do
$ GRAPTERM=apollo
$ GRAPDUMP=postscript
$ export GRAPDUMP
$ export GRAPTERM
Also see STARTUP.
\startup
When GRAPHICA is run, it looks for an initialization file to load.
This file is called GRAPHICA.INI. If this file is not found in the
current directory, the program will look for it in a directory pointed to
by the environment variable GRAPHICA.
If the initialization file is found, GRAPHICA executes the commands
in that file. This is most useful for setting your terminal type and
defining any functions or variables which you use often.
Also see ENVIRONMENT.
\text
Text primitives generate a string of characters on a display device
in a specific location in the world coordinate system. The character
string may comprise letters, numerals, and symbols. Text primitives
provide a method for labeling and clarifying a graphical image.
This section describes the control sequences which are accessible
when specifying a string label. The control sequences are only available
when using a software generated font. GRAPHICA recognizes \ as a special
character used to signal the start of an escape sequence. There are two
kinds of escape sequences, those that take an argument and those that do
not.
The two escape sequences that do not take an argument are:
\U move up half a character size
\D move down half a character size
The following take one integer argument immediately after the escape
sequence and a space after it to delineate the end (the space is not printed):
\Cn set color to n
\C-1 reset color to the default
\Fn set font to n
\F-1 reset font to the default
\Sn set character size to n % of the default size
\S-1 reset character size to the default size
\Ln set character slant to n degrees
\L-1 reset character slant to the default slant
\An print ascii n
\rn save current position in register n
\Rn restore position from register n
Examples:
to print greek characters such as in 'beta = x + lambda':
label '\F2 b\F1 = x + \F2 l'
to label the x-axis with 'velocity U sub f':
xlabel 'velocity, U\Dsub'
to place a top label of 'stress in dynes per cm squared':
top label 'stress (dyn\cm\U2\D)'
to get 'x squared plus y squared':
label 'x\U2\D + y\U2'
and finally, an advanced example. To get 'A sub b sup beta':
label 'A\r1 \Db\R1 \U\F2 b'
This last example is translated as: do A, save this spot, go down half,
do b, restore the saved spot, go up half, switch to font 2 (greek simplex),
do beta. Notice the use of registers to stack characters on top of each
other.
To get a backslash, you'll have to use \\.
\show version
\version
The 'show version' or 'version' command displays:
- your GRAPHICA version number
- pertinent copyright and other information
Also on DOS systems:
- the amount of system RAM available
- the amount of disk space available in the current drive
Syntax:
show version
version
\userdefined
\variables
User-defined function syntax:
<function-name> ( <dummy-var> ) = <expression>
show functions
where <expression> is defined in terms of <dummy-var>.
User-defined variable syntax:
<variable-name> = <constant-expression>
show variables
Description:
You may define your own functions and variables. User-defined
functions and variables may be used anywhere an expression is called for.
Variable and function names are case sensitive; thus "A" is not
equivalent to "a". A function refers to a general expression and can take
one argument (dummy variable).
Examples:
graphica> w = 2
graphica> q = floor(tan(pi/2 - 0.1))
graphica> f(x) = sin(w*x)
graphica> sinc(x) = sin(pi*x)/(pi*x)
graphica> delta(t) = (t == 0)
graphica> ramp(t) = (t > 0) ? t : 0
The following variables have already been defined for you:
pi = 3.14159
e = 2.71828
catalan = 0.91597
degree = 0.01745
gamma = 0.57721
goldr = 1.61803
Note: case matters, e.g., 'Alpha' is different from 'alpha'.
\show functions
The 'show functions' command lists all user-defined functions and their
definitions.
Syntax:
show functions
\who
\show variables
The 'who' or 'show variables' commands list all user-defined variables
and their values.
Syntax:
who
show variables
Example:
graphica> who
The following variables have already been defined for you:
pi = 3.14159
e = 2.71828
catalan = 0.91597
degree = 0.01745
gamma = 0.57721
goldr = 1.61803
Also see VARIABLES.
\bugs
Notes:
-----
No text control characters (see TEXT) when using the hardware font.
Subscript/superscript size hasn't been implemented yet. Use the \S
command (described in TEXT) to change the character size of superscripts
and subscripts.
Help:
----
GRAPHICA is under constant revision, updating and being given expanded
capabilities. Prior to each release, the developer strives to verify new
features and bug fixes through testing. However, as inevitably happens with
any software, some bugs do survive and show up in user runs. Users can aid
in the problem fixing process by following the guidelines below:
a) Report any unusual messages, computed results, format overflows, etc.
even though the program appears to have terminated normally.
b) For any abnormal program termination, save the input file and all
output obtained by running the program.
Reported problems will be fixed as quickly as possible. In most
instances, alternate methods or techniques of plot formulation and input
are available to permit graphing despite the bug. All problems
encountered with GRAPHICA should be reported to:
Antonio Montes
Mailbox 13
Leiderdorp AA 2350
The Netherlands
e-mail address:
CompuServe: 71031,1162
Internet: 71031.1162@compuserve.com